/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.emergency.resources.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopes.bizz.emergency.common.constant.enums.ParkEmergencySysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 应急车辆
 *
 * @author cx
 * @date 2023-10-31 16:48:15
 */
@Data
@TableName(value = "er_car")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "应急车辆")
public class ErCarEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 所属单位
	*/
    @Schema(description="所属单位")
    private Long orgId;

	/**
	* 单位名称
	*/
    @Schema(description="单位名称")
    private String companyName;

	/**
	* 车辆名称
	*/
    @Schema(description="车辆名称")
    private String carName;

	/**
	* 车辆地址
	*/
    @Schema(description="车辆地址")
    private String carLocation;

	/**
	* 车牌号
	*/
    @Schema(description="车牌号")
    private String plateNumber;

	/**
	* 车辆类型
	*/
    @Schema(description="车辆类型")
    private Integer carType;

	/**
	* 报废日期
	*/
    @Schema(description="报废日期")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date scrapTime;

	/**
	* 使用情况
	*/
    @Schema(description="使用情况")
    private String useCase;

	/**
	* 物质配备情况
	*/
    @Schema(description="物质配备情况")
    private String materialEquipment;

	/**
	* 荷载量
	*/
    @Schema(description="荷载量")
    private String loading;

	/**
	* 荷载量单位
	*/
    @Schema(description="荷载量单位")
    private String loadUnit;

	/**
	* 型号
	*/
    @Schema(description="型号")
    private String carSpecification;

	/**
	* 数量
	*/
    @Schema(description="数量")
    private Integer carNum;

	/**
	* 车辆图片
	*/
    @Schema(description="车辆图片")
    private String carImageFile;

	/**
	* 第一负责人
	*/
    @Schema(description="第一负责人")
    private String firstPerson;

	/**
	* 第一负责人电话
	*/
    @Schema(description="第一负责人电话")
    private String firstPersonTelephone;

	/**
	* 第一负责人手机
	*/
    @Schema(description="第一负责人手机")
    private String firstPersonMobilephone;

	/**
	* 经度
	*/
    @Schema(description="经度")
    private String longitude;

	/**
	* 维度
	*/
    @Schema(description="维度")
    private String latitude;

	/**
	* 高度
	*/
    @Schema(description="高度")
    private String altitude;

	/**
	* 车辆定位
	*/
    @Schema(description="车辆定位")
    private String carSite;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remarks;

	/**
	 * 是否使用
	 */
	@Schema(description="是否使用")
	private String useFlag;

	/**
	 * 过期状态
	 */
	@Schema(description="过期状态")
	private Integer overdueStatus;


	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company,this.orgId);
	}
	public String getCarTypeStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_car_type, this.getCarType());
	}
	public String getUseCaseStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_use_case, this.getUseCase());
	}

	public String getUseFlagStr() {
		return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.useFlag);
	}

	public String getOverdueStatusStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_plan_overdue_status, this.getOverdueStatus());
	}
}